package com.icookie.shuatim.api.service;

import com.shuatim.common.utils.Result;
import com.shuatim.model.wechat.FrontThirdSessionRequest;
import com.shuatim.model.wechat.HistoryPaper;
import com.shuatim.model.wechat.Issues;
import com.shuatim.model.wechat.User;

import java.util.List;

/**
 * @author : cookie ✌️
 * @date : 2018/11/3 9:45
 */
public interface WxApiService {
    /**
     * 根据试卷类型查询
     *
     * @param type 试卷类型
     * @return a String
     */
    Result queryPapers(String type);

    /**
     * 保存用户反馈
     *
     * @param issues issues
     * @return new result()
     */
    Result saveIssues(Issues issues);

    /**
     * 根据openID查询用户反馈数量
     *
     * @param userId 用户id
     * @return new Result()
     */
    Result issuesCount(String userId);

    /**
     * 查询用户历史试题
     *
     * @param userId 用户id
     * @return List<HistoryPaper>
     */
    List<HistoryPaper> hPapers(String userId);

    /**
     * 根据用户id修改用户信息
     *
     * @param user user
     * @return new Result()
     */
    Result editUserInfo(User user);

    /**
     * 根据试卷id查询对映试题
     *
     * @param paperId  试卷id
     * @param category 试卷id
     * @return new Result()
     */
    Result queryQuestions(Integer paperId, Integer category);

    /**
     * 用户登录
     *
     * @param frontThirdSessionRequest frontThirdSessionRequest
     * @return new string
     */
    Result login(FrontThirdSessionRequest frontThirdSessionRequest);

    /**
     * 获取用户信息
     *
     * @param appId         appid
     * @param sessionKey    sessionKey
     * @param signature     签名
     * @param rawData       rawData
     * @param encryptedData encryptedData
     * @param iv            iv
     * @return new String
     */
    String info(String appId, String sessionKey, String signature, String rawData, String encryptedData, String iv);


    Result setSignature(String signature);

    Result queryAnswerSheet(long pid, int type);
}
